package cc.mrbird.febs.system.domain;

import java.math.BigDecimal;

import cc.mrbird.febs.common.annotation.Desensitized;
import cc.mrbird.febs.common.annotation.IsRightFormat;
import cc.mrbird.febs.common.annotation.NotBlank;
import cc.mrbird.febs.common.domain.RegexpConstant;
import cc.mrbird.febs.common.enums.FormatType;
import cc.mrbird.febs.common.enums.SensitiveType;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Pattern;

/**
 *
 *
 * @author dtwei
 */
@Data
@TableName("t_resident")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TResident implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 性别
     */
    public static final String SEX_MALE = "0";

    public static final String SEX_FEMALE = "1";

    /**
     * 居民ID
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 居民姓名
     */
    @TableField("RS_NAME")
    @NotBlank(message = "{required}")
    private String rsName;

    /**
     * 身份证号
     */
    @TableField("CARD_ID")
    @NotBlank(message = "{required}")
    @IsRightFormat(type = FormatType.ID_CARD)
    @Desensitized(type = SensitiveType.ID_CARD)
    private String cardId;

    /**
     * 出生日期
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("BIRTHDAY")
    private Date birthday;

    /**
     * 0男1女
     */
    @TableField("SSEX")
    private String ssex;

    /**
     * 民族
     */
    @TableField("NATION")
    private String nation;

    /**
     * 联系电话
     */
    @TableField("MOBILE")
    @Pattern(regexp = RegexpConstant.MOBILE_REG, message = "{mobile}")
    @Desensitized(type = SensitiveType.MOBILE)
    private String mobile;

    /**
     * 政治面貌
     */
    @TableField("POLITICS")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String politics;

    /**
     * 所属支部
     */
    @TableField("POLITICS_BRANCH")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String politicsBranch;

    /**
     * 户籍所在地
     */
    @TableField("CENSUS_ADR")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String censusAdr;

    /**
     * 文化程度
     */
    @TableField("CULTURE")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String culture;

    /**
     * 就业、就学单位
     */
    @TableField("WORK_UNIT")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String workUnit;

    /**
     * 外出务工地点
     */
    @TableField("WORK_ADR")
    @Desensitized(type = SensitiveType.ADDRESS)
    private String workAdr;

    /**
     * 年收入
     */
    @TableField("INCOME")
    private BigDecimal income;

    /**
     * 特殊人员信息
     */
    @TableField("STATUS")
    private String status;

    /**
     * 创建时间
     */

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("CREATE_TIME")
    private Date createTime;

    /**
     * 修改时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("MODIFY_TIME")
    private Date modifyTime;

    @TableField("CREATE_USERNAME")
    private String createUsername;

    @TableField("CREATE_USER_ID")
    private Long createUserId;

    @TableField("MODIFY_USERNAME")
    private String modifyUsername;

    @TableField("MODIFY_USER_ID")
    private Long modifyUserId;

    private transient String createTimeFrom;
    private transient String createTimeTo;
}
